package com.anlogic.sdk.bootimage.internal.ui;

import com.anlogic.sdk.bootimage.model.Partition;
import com.anlogic.sdk.bootimage.model.options.PartionType;
import org.eclipse.jface.viewers.ColumnLabelProvider;

public class PartitionLabelProvider extends ColumnLabelProvider {
	int col;

	public PartitionLabelProvider(int i) {
		this.col = i;
	}

	public String getText(Object element) {
		if (element instanceof Partition) {
			Partition section = (Partition) element;
			switch (this.col) {
			case 0:
				if (section.getPartitionType().equals(PartionType.DATAFILE))
					return section.getFilePath();
				return "(" + section.getPartitionType().toString().toLowerCase() + ") " + section.getFilePath();
			case 1:
				return section.getEncryptionType().toString().toLowerCase();
			case 2:
				return section.getAuthenticationType().toString().toLowerCase();
			}
		}
		return "";
	}
}
